Imports System
Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms
Imports DevExpress.CodeRush.Core
Imports DX_Contrib.Painting
Namespace CR_UnusedVariables
	''' <summary>
	''' Summary description for OptUnusedVariables.
	''' </summary>
    Public Class OptUnusedVariables
        Inherits OptionsPage
        Dim DefaultColor As System.Drawing.Color = Color.Blue
        Dim DefaultPaintPicker As New PaintOptions(PaintRequestEnum.UnderlineWavy, Color.Red)
#Region " private fields... "
        Private components As System.ComponentModel.Container = Nothing
#End Region
#Region " OptUnusedVariables "
        Public Sub New()
            MyBase.New()
            ''' <summary>
            ''' Required for Windows.Forms Class Composition Designer support
            ''' </summary>
            InitializeComponent()
        End Sub
#End Region
#Region " CodeRush generated code "
        Protected Overrides Sub Initialize()
            MyBase.Initialize()

            '
            ' TODO: Add your initialization code here.
            '
        End Sub

        Public Shared Function GetCategory() As String
            Return "Editor\Painting"
        End Function

        Public Shared Function GetPageName() As String
            Return "Unused Variables"
        End Function

        Public Shared ReadOnly Property Storage() As DecoupledStorage
            Get
                Return DevExpress.CodeRush.Core.CodeRush.Options.GetStorage(GetCategory(), GetPageName())
            End Get
        End Property

        Public Overrides ReadOnly Property Category() As String
            Get
                Return OptUnusedVariables.GetCategory()
            End Get
        End Property

        Public Overrides ReadOnly Property PageName() As String
            Get
                Return OptUnusedVariables.GetPageName()
            End Get
        End Property

        Public Shared Shadows Sub Show()
            DevExpress.CodeRush.Core.CodeRush.Command.Execute("Options", FullPath)
        End Sub

        Public Shared ReadOnly Property FullPath() As String
            Get
                Return GetCategory() + "\" + GetPageName()
            End Get
        End Property
#End Region
#Region " Component Designer generated code "
        ''' <summary>
        ''' Required method for Designer support - do not modify
        ''' the contents of this method with the code editor.
        ''' </summary>
        Friend WithEvents ColorDialog1 As System.Windows.Forms.ColorDialog
        Friend WithEvents Label1 As System.Windows.Forms.Label
        Friend WithEvents UnusedPaintPicker As DX_Contrib.Controls.PaintPicker
        Private Sub InitializeComponent()
            Me.ColorDialog1 = New System.Windows.Forms.ColorDialog
            Me.UnusedPaintPicker = New DX_Contrib.Controls.PaintPicker
            Me.Label1 = New System.Windows.Forms.Label
            CType(Me, System.ComponentModel.ISupportInitialize).BeginInit()
            Me.SuspendLayout()
            '
            'UnusedPaintPicker
            '
            Me.UnusedPaintPicker.Decoration = DX_Contrib.Painting.PaintRequestEnum.BrushStroke
            Me.UnusedPaintPicker.Location = New System.Drawing.Point(24, 40)
            Me.UnusedPaintPicker.Name = "UnusedPaintPicker"
            Me.UnusedPaintPicker.Size = New System.Drawing.Size(432, 24)
            Me.UnusedPaintPicker.TabIndex = 9
            '
            'Label1
            '
            Me.Label1.Location = New System.Drawing.Point(24, 8)
            Me.Label1.Name = "Label1"
            Me.Label1.Size = New System.Drawing.Size(240, 23)
            Me.Label1.TabIndex = 10
            Me.Label1.Text = "Please select paint style for unused variables."
            '
            'OptUnusedVariables
            '
            Me.Controls.Add(Me.Label1)
            Me.Controls.Add(Me.UnusedPaintPicker)
            Me.Name = "OptUnusedVariables"
            CType(Me, System.ComponentModel.ISupportInitialize).EndInit()
            Me.ResumeLayout(False)

        End Sub
#End Region
#Region " Dispose "
        ''' <summary>
        ''' Clean up any resources being used.
        ''' </summary>
        Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If Not components Is Nothing Then
                    components.Dispose()
                End If
                MyBase.Dispose(disposing)
            End If
        End Sub
#End Region
        Private Sub OptUnusedVariables_PreparePage(ByVal sender As Object, ByVal ea As DevExpress.CodeRush.Core.OptionsPageStorageEventArgs) Handles MyBase.PreparePage
            LoadStyle(ea.Storage, "Options", "Unused", UnusedPaintPicker, DefaultPaintPicker)
        End Sub
        Private Sub OptUnusedVariables_CommitChanges(ByVal sender As Object, ByVal ea As DevExpress.CodeRush.Core.OptionsPageStorageEventArgs) Handles MyBase.CommitChanges
            SaveStyle(ea.Storage, "Options", "Unused", UnusedPaintPicker)
        End Sub
        Private Sub OptUnusedVariables_RestoreDefaults(ByVal sender As Object, ByVal ea As DevExpress.CodeRush.Core.OptionsPageEventArgs) Handles MyBase.RestoreDefaults
            Call Copy(DefaultPaintPicker, UnusedPaintPicker)
        End Sub
    End Class
End Namespace
